package com.zkCloud.order.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class OrderController {

    private static final String PAYMENT_SERVER = "http://cloud-provider-payment";

    @Autowired
    private RestTemplate restTemplate;

    /**
     * 通过restTemplate方式调用支付服务。
     * service、dao省略
     * @return
     */
    @GetMapping(value = "/consumer/payment/zk")
    public String paymentInfo() {
        String result = restTemplate.getForObject(PAYMENT_SERVER + "/payment/zk", String.class);
        return result;
    }

}
